﻿<UserControl x:Class="DiscoveryLogic.Analytics.Modules.LinkRules.LinkRuleDistanceCalculator"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    Height="350" Width="450" Loaded="UserControl_Loaded">
    <Border CornerRadius="10">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="35" />
                <RowDefinition Height="35" />
                <RowDefinition Height="*" />
                <RowDefinition Height="35" />
                <RowDefinition Height="35" />
                <RowDefinition Height="35" />
            </Grid.RowDefinitions>
            
            <StackPanel 
                Grid.Row="0" Orientation="Horizontal" 
                HorizontalAlignment="Stretch">
                <Label Margin="4,0,4,0" VerticalAlignment="Center">Distance calculator</Label>
                <ComboBox x:Name="cboCalculator" MinWidth="300" Margin="4,0,4,0" VerticalAlignment="Center"
                          SelectionChanged="cboCalculator_SelectionChanged"></ComboBox>
            </StackPanel>
            
            <StackPanel 
                Grid.Row="1" Orientation="Horizontal" 
                HorizontalAlignment="Stretch" VerticalAlignment="Center">
                <CheckBox x:Name="ckDirectional" Content="Is directional" IsChecked="False" Margin="5,0,0,0"/>
            </StackPanel>
            
            <CheckBox Grid.Row="3" x:Name="ckAllowLoopback" Content="Allow loopback" Margin="4,0,4,0" Checked="ckAllowLoopback_Checked" VerticalAlignment="Center"></CheckBox>
            <StackPanel Grid.Row="4" Orientation="Horizontal">
                <Label Margin="4,0,4,0" Width="120">Distance threshold:</Label>
                <Slider 
                    x:Name="rngThreshold" Orientation="Horizontal" 
                    Margin="4,0,4,0" Minimum="0" Maximum="100" Value="100"
                    VerticalAlignment="Center" Width="100"
                    ValueChanged="rngThreshold_ValueChanged"></Slider>
                <Label 
                    x:Name="lblThresholdValue" Margin="5,0,0,0" VerticalAlignment="Center">100</Label>
            </StackPanel>
            <StackPanel Grid.Row="5" Orientation="Horizontal">
                <Label Margin="4,0,4,0" Width="120">Hop damp factor:</Label>
                <Slider 
                    x:Name="rngHopDampFactor" Value="0.1"
                    Orientation="Horizontal" Margin="4,0,4,0" 
                    Minimum="0" Maximum="1.0" TickFrequency="0.1"
                    VerticalAlignment="Center" 
                    Width="100" ValueChanged="rngHopDampFactor_ValueChanged"></Slider>
                <Label x:Name="lblHopDampValue" Margin="5,0,0,0" VerticalAlignment="Center">0 .1</Label>
            </StackPanel>
            
            <WindowsFormsHost 
                Grid.Row="2"
                Margin="10" HorizontalAlignment="Stretch" 
                VerticalAlignment="Stretch" >
                <Forms:DataGridView x:Name="dvArgBindings" Dock="Fill">
                    <Forms:DataGridView.Columns>
                        <Forms:DataGridViewTextBoxColumn HeaderText="Argument" Width="100"/>
                        <Forms:DataGridViewComboBoxColumn HeaderText="Source field" Width="120"/>
                        <Forms:DataGridViewComboBoxColumn HeaderText="Target field" Width="120"/>
                    </Forms:DataGridView.Columns>
                </Forms:DataGridView>
            </WindowsFormsHost>
        </Grid>
    </Border>
</UserControl>
